package com.hustzp.com.xichuangzhu.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

import com.hustzp.com.xichuangzhu.XichuangzhuApplication;

/**
 * Copyright (C) 2015 The huimai mobile client Project
 * All right reserved.
 *
 * @author: wuzhimin@huimai365.com
 * @date: 2016/6/14 10:49
 * @Description:
 */
public class FontTextView extends TextView {

    public FontTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public FontTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public FontTextView(Context context) {
        super(context);
    }

    public void setTypeface() {
        if (0 == XichuangzhuApplication.getInstance().getFontStyle()) {
            this.setTypeface(XichuangzhuApplication.getInstance().getTypefaceHuaWenWyue());
        } else {
            this.setTypeface(XichuangzhuApplication.getInstance().getTypefaceHuaWenFangSong());
        }
    }

    public void setTypeface(int type) {
        if (0 == type) {
            this.setTypeface(XichuangzhuApplication.getInstance().getTypefaceHuaWenWyue());
        } else {
            this.setTypeface(XichuangzhuApplication.getInstance().getTypefaceHuaWenFangSong());
        }
    }
}